chore: rename and add trigger in journal entry

(cherry picked from commit 0ccb6d8242)
This commit is contained in:
ruthra kumar
2023-08-29 21:49:21 +05:30
committed by Mergify
parent f4e1959cc7
commit 84e4a2509c
3 changed files with 4 additions and 2 deletions

View File

@@ -50,6 +50,8 @@ frappe.ui.form.on("Journal Entry", {
frm.trigger("make_inter_company_journal_entry");
}, __('Make'));
}
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm);
},
before_save: function(frm) {
if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) {

View File

@@ -54,7 +54,7 @@ class UnreconcilePayments(Document):
@frappe.whitelist()
def doc_has_payments(doctype, docname):
def doc_has_references(doctype, docname):
if doctype in ["Sales Invoice", "Purchase Invoice"]:
return frappe.db.count(
"Payment Ledger Entry",

View File

@@ -4,7 +4,7 @@ erpnext.accounts.unreconcile_payments = {
add_unreconcile_btn(frm) {
if (frm.doc.docstatus == 1) {
frappe.call({
"method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.doc_has_payments",
"method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.doc_has_references",
"args": {
"doctype": frm.doc.doctype,
"docname": frm.doc.name