Merge pull request #39950 from frappe/mergify/bp/version-15-hotfix/pr-39943

refactor: use popup to inform on additional reconciliation step for Cr/Dr Notes (backport #39943)
This commit is contained in:
ruthra kumar 2024-02-19 07:48:27 +05:30 committed by GitHub
commit a2a5b34099
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -216,6 +216,18 @@ class AccountsController(TransactionBase):
)
)
if self.get("is_return") and self.get("return_against"):
document_type = "Credit Note" if self.doctype == "Sales Invoice" else "Debit Note"
frappe.msgprint(
_(
"{0} will be treated as a standalone {0}. Post creation use {1} tool to reconcile against {2}."
).format(
document_type,
get_link_to_form("Payment Reconciliation", "Payment Reconciliation"),
get_link_to_form(self.doctype, self.get("return_against")),
)
)
pos_check_field = "is_pos" if self.doctype == "Sales Invoice" else "is_paid"
if cint(self.allocate_advances_automatically) and not cint(self.get(pos_check_field)):
self.set_advances()