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

Fixing multiple design issues in Payment Request #42280

Closed
sagarvora opened this issue Jul 11, 2024 · 0 comments · Fixed by #42427
Closed

Fixing multiple design issues in Payment Request #42280

sagarvora opened this issue Jul 11, 2024 · 0 comments · Fixed by #42427
Assignees
Labels

Comments

@sagarvora
Copy link
Collaborator

sagarvora commented Jul 11, 2024

Issues

When a Payment Request is partially paid, it does not allow further payments towards the remaining amount.

  • It does not keep a record of how much is unpaid (outstanding_amount).
  • The reference number can be changed by the user of Payment Entry, which can result in the loss of link to Payment Request.
  • When creating Payment Entry from Payment Request, the party_amount is incorrectly set to the total amount of the reference transaction if the following condition gets triggered:
    if party_account_currency == ref_doc.company_currency and party_account_currency != self.currency:
  • Payment Request status is always set to Partially Paid if Payment Request amount is less than the reference transaction total, because this status is always set based on reference transaction amounts.
  • Negative Amount is allowed.
  • Advance Payment Statuses in PO/SO are incorrect.

Internal Ticket: https://support.frappe.io/helpdesk/tickets/18503

Proposal

  • Add a Payment Request link field in the reference table of Payment Entry.
    • This will maintain the reference of the Payment Request for which this Payment Entry was created.
    • It will be used to retrieve the amount paid in the past.
  • Add an Outstanding Amount field in Payment Request. This will track the amount remaining to be paid.
  • Modify the flow of create_payment_entry():
    • Fetch the amount from the outstanding_amount field instead of grand_total.
    • Ensure that party_amount is set correctly in all cases.
  • (?) Add a validation on the save of linked Payment Entry that the amount should not be higher than the total amount of Payment Request.
  • Update status of Payment Request based on amounts in Payment Request, instead of amounts in reference transaction.
  • Don't allow negative amount.
  • Set correct advance payment statuses.

Caveat

This change will not update old Payment Requests as Paid where they were earlier Partially Paid, because there is no way to determine the outstanding amount reliably for existing Payment Requests.

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