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

fix: update status of reference documents #2380

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

AyshaHakeem
Copy link
Contributor

Fixes the status issue for gratuity payments. When a Full & Final Statement is marked as 'Paid,' the linked gratuity doc's status updates to 'Paid' too.

@@ -310,3 +313,9 @@ def update_full_and_final_statement_status(doc, method=None):
fnf = frappe.get_doc("Full and Final Statement", entry.reference_name)
fnf.db_set("status", status)
fnf.notify_update()


def update_status_of_reference_documents(doc, status="Paid"):
Copy link
Member

@ruchamahabal ruchamahabal Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We can encapsulate this function I think. No need to keep it outside the class
  • Gratuity holds a "paid_amount" field. We should update that and call gratuity.set_status to update the status. If we just update the status, paid_amount field will remain 0
  • This should also mark gratuity as unpaid when FnF is cancelled. Current logic will change gratuity status to Cancelled I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can you add a test 🙈

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

Successfully merging this pull request may close these issues.

2 participants